xen: credit1: simplify csched_runq_steal() a little bit.
authorDario Faggioli <dario.faggioli@citrix.com>
Fri, 7 Apr 2017 16:56:31 +0000 (18:56 +0200)
committerGeorge Dunlap <george.dunlap@citrix.com>
Fri, 7 Apr 2017 17:17:38 +0000 (18:17 +0100)
commitc95ac0ad200d17db2d3ac8f0845d2158a369495c
treee8cf55d25baeee3cf9cb854c153ec5d2854ed77b
parentef7f5bbf9d77062de6bdd4a5801af97b903644ac
xen: credit1: simplify csched_runq_steal() a little bit.

Since we're holding the lock on the pCPU from which we
are trying to steal, it can't have disappeared, so we
can drop the check for that (and convert it in an
ASSERT()).

And since we try to steal only from busy pCPUs, it's
unlikely for such pCPU to be idle, so we can:
 - tell the compiler this is actually unlikely,
 - bail early if the pCPU, unfortunately, turns out
   to really be idle.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
xen/common/sched_credit.c